<?php
  if (in_array($current_page_base,explode(",",'list_pages_to_skip_all_right_sideboxes_on_here,separated_by_commas,and_no_spaces')) ) {
    $flag_disable_right = true;
  }
  $header_template = 'tpl_header.php';
  $footer_template = 'tpl_footer.php';
  $left_column_file = 'column_left.php';
  $right_column_file = 'column_right.php';
  $body_id = ($this_is_home_page) ? 'indexHome' : str_replace('_', '', $_GET['main_page']);
?>
<body id="<?php echo $body_id . 'Body'; ?>"  <?php if($zv_onload !='') echo ' onload="'.$zv_onload.'"'; ?>  >
<div id="wrapper">
<div id="pop_window" style="display:none"></div>
<!-- bof  header -->
<?php
  if (CUSTOMERS_APPROVAL_AUTHORIZATION == 1 && CUSTOMERS_AUTHORIZATION_HEADER_OFF == 'true' and ($_SESSION['customers_authorization'] != 0 or $_SESSION['customer_id'] == '')) {
    $flag_disable_header = true;
  }
  require($template->get_template_dir('tpl_header.php',DIR_WS_TEMPLATE, $current_page_base,'common'). '/tpl_header.php');
?>
<!-- eof  header -->

<?php
if (isset($_GET['c']) and $_GET['c'] == 'only'){
  echo '<div class="comm1">';
}else{
  switch ($current_page){
    case 'faqs_submit':
      echo '<div class="new1">';
      break;
    case 'shipping_estimator':
      echo '<div>';
      break;
    case 'print_page':
      echo '<div class="lightinthebox" style="width: 760px;">';
      break;
    case 'checkout_shipping':
    case 'checkout_payment':
    case 'checkout_login':
    case 'checkout_shipping_address':
    case 'address_book_process':
    	echo '<div class="lightinthebox">';
    	break;
    default:
    	echo '<div class="lightinthebox">';
  }	
}

?>

<?php
//addPage
if(!$this_is_home_page and ($current_page != 'login') and ($current_page != 'print_page') 
and ($current_page != 'advanced_search') and ($current_page != 'shopping_cart') 
and ($current_page != 'checkout_shipping_address') and ($current_page != 'address_book_process') 
and ($current_page != 'checkout_payment_address') and ($current_page != 'checkout_shipping') 
and ($current_page != 'checkout_login') and ($current_page != 'checkout_payment') 
and ($current_page != 'checkout_confirmation') and ($current_page != 'checkout_success') 
and $current_page != 'faqs_submit' and $current_page != 'shipping_estimator' 
and (!isset($_GET['c']) and $_GET['c'] == '')){
?>
	<div id="navblock" class="fl">
    <?php
		if (SHOW_BANNERS_GROUP_SET2 != '' && $banner = zen_banner_exists('dynamic', SHOW_BANNERS_GROUP_SET2)) {
			if ($banner->RecordCount() > 0) {
	?>
		<div id="bannerThree" class="banners"><?php echo zen_display_banner('static', $banner); ?></div>
		<?php
			}
		}	
	?>
  <!-- bof  breadcrumb -->
  <?php
	  if ($current_page == 'super_savings'){
		//Do anything
	  }else{
			 if (DEFINE_BREADCRUMB_STATUS == '1' || (DEFINE_BREADCRUMB_STATUS == '2' && !$this_is_home_page) ) { ?>
		  <div class="fl product_title margin_t pad_1em"><?php echo $breadcrumb->trail(BREAD_CRUMBS_SEPARATOR); ?></div>
			<?php }
	  }
	?>
  <!-- eof breadcrumb -->
</div>
<br class="clear">
<?php		
  }
?>
	<div id="bodyblock">
	<?php
    //addPage
    if($this_is_home_page || $current_page == 'login' || 
	$current_page == 'shopping_cart' || $current_page == 'advanced_search' || 
	$current_page == 'shopping_cart' || $current_page == 'checkout_payment_address' ||
	$current_page == 'checkout_confirmation'|| $current_page == 'checkout_success'){
        if (COLUMN_LEFT_STATUS == 0 || (CUSTOMERS_APPROVAL == '1' and $_SESSION['customer_id'] == '') 
		|| (CUSTOMERS_APPROVAL_AUTHORIZATION == 1 && 
		CUSTOMERS_AUTHORIZATION_COLUMN_LEFT_OFF == 'true' and 
		($_SESSION['customers_authorization'] != 0 or $_SESSION['customer_id'] == ''))) {
          // global disable of column_left
          $flag_disable_left = true;
        }
        if (!isset($flag_disable_left) || !$flag_disable_left) {
		?>
			<div class="minframe fl">
			  <?php
			 /**
			  * prepares and displays left column sideboxes
			  *
			  */
				  switch($current_page){
					case 'login':
					case 'shopping_cart':
					case 'checkout_payment_address':
					case 'checkout_confirmation':
					case 'checkout_success':
					case 'time_out':
					case 'faqs_all':
					case 'advanced_search':
						//require(DIR_WS_MODULES . 'sideboxes/' . $template_dir . '/categories_css.php');
						require(DIR_WS_MODULES . 'sideboxes/' . $template_dir . '/subscribe.php');
						break;
					default:
						require(DIR_WS_MODULES . zen_get_module_directory('column_left.php'));
				  }
				?>
			</div>
		<?php
		}
	}
    ?>
	
<?php
//addPage
if($this_is_home_page || $current_page == 'login' || 
$current_page == 'shopping_cart' || $current_page == 'advanced_search' || 
$current_page == 'time_out'  || $current_page == 'checkout_payment_address' ||
$current_page == 'checkout_confirmation'|| $current_page == 'checkout_success'){ ?>
<div class="maxframe">
  <?php }elseif ($current_page =='faqs_all' || $current_page =='faqs_submit' ){ ?>
  <div class="fl">
    <?php }else { ?>
    <div>
      <? }?>
      <?php

//addPage
if($this_is_home_page || $current_page == 'login' || 
$current_page == 'shopping_cart' || 
$current_page == 'advanced_search' || 
$current_page == 'checkout_payment_address' || 
$current_page == 'checkout_confirmation'|| 
$current_page == 'checkout_success' ){}?>
<?php
if ($this_is_home_page){
  if (SHOW_BANNERS_GROUP_SET1 != '' && $banner = zen_banner_exists('dynamic', SHOW_BANNERS_GROUP_SET1)) {
    if ($banner->RecordCount() > 0) {
?>
      <div id="bannerOne" class="banners"><?php echo zen_display_banner('static', $banner); ?></div>
      <?php
			}
		}
	}
?>
<!-- bof upload alerts -->
<?php if ($messageStack->size('upload') > 0) echo $messageStack->output('upload'); ?>
	<!-- eof upload alerts -->
<?php require($body_code);?>
</div>

<?php 
	//if($this_is_home_page){
	//require($template->get_template_dir('tpl_modules_bottom_featured.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_modules_bottom_featured.php');
	//}
?>

<?php if (DEFINE_MAIN_PAGE_STATUS >= 1 and DEFINE_MAIN_PAGE_STATUS <= 2 and $this_is_home_page) { ?>
	<br class="clear">
    <div class="pad_top">	
    <div id="bottom-01">
      <?php require($define_page); ?>
    </div>
    </div>
<?php } ?>
   
 
<?php
/** 
  if ($this_is_home_page){
	echo '<br class="clear"/>';
   require(DIR_WS_MODULES . zen_get_module_directory('sideboxes/'.$template_dir.'/links_box.php'));
  }

*/
?>
<br class="clear"/>
</div>
<?php
   /**
    * prepares and displays footer output
    *
    */
    if (CUSTOMERS_APPROVAL_AUTHORIZATION == 1 && CUSTOMERS_AUTHORIZATION_FOOTER_OFF == 'true' and ($_SESSION['customers_authorization'] != 0 or $_SESSION['customer_id'] == '')) {
      $flag_disable_footer = true;
    }
    require($template->get_template_dir('tpl_footer.php',DIR_WS_TEMPLATE, $current_page_base,'common'). '/tpl_footer.php');
    ?>
</div>

</body>